package com.tjbank.cssys.web.config.threadPoolExample;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.Executor;

@Service
public class TreadPoolExcutorDemol {
    @Resource(name = "mytaskThreadExecutor")
    private Executor taskExecutorPool;
    public void putDetail() {

        String [ ] arr={"1","2","3","4","5","6","7","8","9","10"};
        int i=0;
        for ( i = 0; i < 10; i++) {
            TaskOrder taskOrder=new TaskOrder();
            taskOrder.setTest(arr[i]);
            taskExecutorPool.execute(taskOrder);
        }
    }

}
